# tele=set()
# for i in range(1,6):
#     person=input(f'请输入第{i}位好友的姓名和手机号:')
#     tele.add(person)
# for i in tele:
#     print(i)
goods=list()
for i in range(5):
    good=input("请输入商品名称： ")
    goods.append(good)
print(goods)
car=list()
while True:
    bug=input("请选择商品： ")
    flag=False
    for item in goods:
        if bug==item:
            flag=True
            car.insert(0,item)
            print("商品已经成功添加到购物车")
            break
    if not flag and bug !='q':
        print("商品不存在")
    if bug=='q':
        print("程序结束")
        break
print(car)
print("程序结束")



